<template>
  <div>
    官方电话给
    {{ num }}
    <button @click="addChild">父组件传的方法</button>

    <button @click="emitPar">子传父</button>
    <List />
  </div>
</template>
<script>
import List from '../List/index.vue'

export default {
  components: {
    List,
  },
  data() {
    return {
      sum: 455,
    }
  },
  props: {
    num: {
      type: [String, Number],
      required: false,
      default: () => '35465',
    },
    addChild: {
      type: Function,

      default: () => {},
    },
  },
  mounted() {
    // console.log(this,"===============");
    console.log(this.$parent, '父组件')
  },
  methods: {
    emitPar() {
      this.$emit('getSum', { name: 'dsfd', age: 12 })
    },
  },
}
</script>

<style scoped></style>
